﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Data
{
     public static class Datatools
    {
         public static string getInWhere(string colname,string ids)
         {
             if (ids != null && ids.Length > 0) {
                 string trimids = ids.Trim();
                 if (trimids != null && trimids.Length > 0)
                 {
                     if (trimids.IndexOf(",") > 0)
                     {
                         return colname + " IN(" + trimids + ")";
                     }
                     else
                     {
                         return colname + "='" + trimids + "'";
                     }
                 }
             }
             return "";
         }
    }
}
